package com.guohengspace.mq.common.exception;

import java.text.MessageFormat;

/**
 * @ClassName BusinessExceptionAssert
 * @Description
 * @Author GuanNing
 * @Date 2023/1/6 17:01
 */
public interface BusinessExceptionAssert extends IResponseEnum, Assert{

    @Override
    default BaseException newException(Object... args) {
        String msg = MessageFormat.format(this.getMessage(), args);

        return new BusinessException(this, args, msg);
    }

    @Override
    default BaseException newException(Throwable t, Object... args) {
        String msg = MessageFormat.format(this.getMessage(), args);

        return new BusinessException(this, args, msg, t);
    }
}
